//
//  MLZPlayListTableViewCell.m
//  MotherLover
//
//  Created by zj on 15/12/31.
//  Copyright © 2015年 zj. All rights reserved.
//

#import "MLZPlayListTableViewCell.h"

@implementation MLZPlayListTableViewCell

- (void)awakeFromNib {
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
  
       
        //图片
        _imageIco = [[UIImageView alloc]initWithFrame:CGRectMake(TLandR, TTandB, (KW - TLandR*3)/4,(KW - TLandR*3)/4)];
        //_imageIco.backgroundColor = [UIColor blackColor];
        //[_imageIco.layer setCornerRadius:((KW - TLandR*3)/3)/2];
        _imageIco.layer.masksToBounds = YES;
        [self.contentView addSubview:_imageIco];
        //标题
        _lableTitle = [[UILabel alloc]initWithFrame:CGRectMake(_imageIco.right+TLandR, TTandB, ((KW - TLandR*3) * 2 / 3), 30)];
        _lableTitle.font = [UIFont systemFontOfSize:20];
        _lableTitle.adjustsFontSizeToFitWidth = YES;
//        _lableTitle.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_lableTitle];
        
        //内容
        _lableContent = [[UILabel alloc]initWithFrame:CGRectMake(_lableTitle.frame.origin.x, _lableTitle.frame.origin.y+_lableTitle.frame.size.height+TTandB, _lableTitle.width, _imageIco.height - _lableTitle.height - TTandB)];
        _lableContent.numberOfLines= -1;
//        _lableContent.textAlignment = NSTextAlignmentCenter;
        //        _lableContent.backgroundColor = [UIColor redColor];
        _lableContent.textColor = [UIColor grayColor];
        [self.contentView addSubview:_lableContent];

        
//         [self addView];
        
        
    }
    return self;

}


- (void)addView{



    
    //往左的箭头
    _imageJT = [[UIImageView alloc]initWithFrame:CGRectMake((_lableContent.frame.origin.x+_lableContent.width+TLandR*2), (150 - _imageIco.width/2)/2, _imageIco.width/2, _imageIco.height/2)];
    _imageJT.image = [UIImage imageNamed:@"wangyou"];
    [self.contentView addSubview:_imageJT];






}
- (void) setModel:(MLZPlayListDetalisModel *)model{
    [_imageIco sd_setImageWithURL:[NSURL URLWithString:model.icon.url]];
    _lableContent.text = model.discription;
    
    
    _lableContent.adjustsFontSizeToFitWidth= YES;
    _lableTitle.text = model.name;






}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
